<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jq-3.6.0.js"></script>
    <style>
        .box {
            width: 300px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            display: flex;
        }
        
        .box>div {
            flex: 1;
            background-color: red;
        }
        /* .box>div:nth-child(1) {
            color: white;
        }
         */
        
        .change {
            color: white;
        }
    </style>
</head>

<body>
    <div class="box">
        <div>按钮1</div>
        <div>按钮2</div>
        <div>按钮3</div>
    </div>
</body>
<script>
    $('.box').children().on('click', function(e) {
        $(e.target).addClass('change').siblings().removeClass('change')
    });
    //$($('.box').children()[1]).triggerHandler('click');
    // $('.box').children()[0].click();
    var a = 1;
    console.log(a);
    setTimeout(() => {
        $('.box').children()[0].click();
        console.log("111111111");
    }, 5000)
    setTimeout(() => {
        $('.box').children()[0].click();
        console.log("22222222");
    }, 2000)
    var b = 2;
    console.log(b);
</script>

</html>